<script type="text/javascript">
var _d = DialogManager.get('config_dialog');
_d.setWidth(400);
_d.setPosition('center');
$(function(){
	$("select[name='img_recom_id_1']").change(function(){
		switchRecommend(this.value, 'img_cate_id_1');
	});
	$("select[name='img_recom_id_2']").change(function(){
		switchRecommend(this.value, 'img_cate_id_2');
	});
	
	switchRecommend($("select[name='img_recom_id_1']").val(), 'img_cate_id_1');
	switchRecommend($("select[name='img_recom_id_2']").val(), 'img_cate_id_2');
});
function switchRecommend(recomId, selectName)
{
    if (recomId >= 0)
    {
        $("select[name='" + selectName + "']").hide();
    }
    else
    {
        $("select[name='" + selectName + "']").show();
    }
}
</script>

<div class="field_item">
    <label>模块名称</label>
    <p><input type="text" name="model_name" value="{$options.model_name}"/></p>
</div>
<div class="field_item">
    <label>关键字（多个关键字用|隔开）</label>
    <p><textarea name="keyword" style="width:300px;height:55px;">{$options.keyword}</textarea></p>
</div>

<div class="field_item">
    <label>左侧显示的分类（多个分类id用半角逗号隔开，如1,2,3,4,5,6）</label>
    <p>
    <textarea name="cate_ids"  style="width:300px;height:50px;">{$options.cate_ids}</textarea>
	</p>
</div>
<div class="field_item">
    <label>中间底部5个商品:</label>
    <p><select name="img_recom_id_1">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id_1 eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id_1">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id_1}
    </select>
	</p>
</div>
<div class="field_item">
	<label>楼层图片1:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:203px * 200px</span>)</label>
    <p><input type="file" name="ad1_image_file" /><input type="hidden" name="ad1_image_url" value="{$options.ad1_image_url}" /></p>
     <!-- {if $options.ad1_image_url} --><p><img src="{$options.ad1_image_url|url_format}" height="20" /></p><!-- {/if} -->
</div>
<div class="field_item">     
    <label>楼层图片1链接地址:</label>
    <p><input type="text" name="ad1_link_url" value="{$options.ad1_link_url}" /></p>
</div>

<div class="field_item">
	<label>楼层图片2:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:350px * 170px</span>)</label>
    <p><input type="file" name="ad2_image_file" /><input type="hidden" name="ad2_image_url" value="{$options.ad2_image_url}" /></p>
     <!-- {if $options.ad2_image_url} --><p><img src="{$options.ad2_image_url|url_format}" height="20" /></p><!-- {/if} -->
</div>
<div class="field_item">     
    <label>楼层图片2链接地址:</label>
    <p><input type="text" name="ad2_link_url" value="{$options.ad2_link_url}" /></p>
</div>
<div class="field_item">
	<label>楼层图片3:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:220px * 170px</span>)</label>
    <p><input type="file" name="ad3_image_file" /><input type="hidden" name="ad3_image_url" value="{$options.ad3_image_url}" /></p>
     <!-- {if $options.ad3_image_url} --><p><img src="{$options.ad3_image_url|url_format}" height="20" /></p><!-- {/if} -->
</div>
<div class="field_item">     
    <label>楼层图片3链接地址:</label>
    <p><input type="text" name="ad3_link_url" value="{$options.ad3_link_url}" /></p>
</div>
<div class="field_item">
	<label>楼层图片4:(<span>支持 gif|jpg|jpeg|png 格式,尺寸:220px * 170px</span>)</label>
    <p><input type="file" name="ad4_image_file" /><input type="hidden" name="ad4_image_url" value="{$options.ad4_image_url}" /></p>
     <!-- {if $options.ad4_image_url} --><p><img src="{$options.ad4_image_url|url_format}" height="20" /></p><!-- {/if} -->
</div>
<div class="field_item">     
    <label>楼层图片4链接地址:</label>
    <p><input type="text" name="ad4_link_url" value="{$options.ad4_link_url}" /></p>
</div>

<div class="field_item">
     <label>右侧商品人气排行</label>
    <p><select name="img_recom_id_2">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id_2 eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id_2">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id_2}
    </select>
	</p>
</div>

